#include "widget.h"
#include <QApplication>
#include "connectmysql.h"
#include "execsql.h"
#include <QDebug>
#include "dialog.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    ConnectMySQL sql;
    if(sql.createConnection())
    {
        qDebug() << "Success:connect DB!!";
    }
    Dialog logFrom;
    if(logFrom.exec() == QDialog::Accepted)
    {
        Widget w;
        w.show();
        int res = a.exec();
        sql.closeConnection();
        return res;
    }
    else
    {
        sql.closeConnection();
        return 0;
    }
}
